<template>
	<view class="pop-promot-box">
		<view class="pop-promot-back">
			<image class="pop-back-img" src="../static/image/homePage/diwen.png" mode="scaleToFill" />
			<view class="pop-content-back">
				<view class="pop-promot-title">{{title}}</view>
				<view class="text-content-view">
					<view class="pwd">
						<uv-input class="pwd-input" :type="pwdType" placeholder="输入房间密码" placeholderStyle="font-size: 14px;text-align: center;" v-model="pwd"></uv-input>
						<!-- <image class="eye" @click="eyeFn()" :src="require('../static/image/icon_pwd' + (pwdType === 'text' ? '' : '_hide') + '.png')" mode=""></image> -->
					</view>
				</view>
				<view class="pop-promot-bottomView">
					<view class="bottom-leftbtn cancelButton" @click="cancel">取消</view>
					<view class="bottom-leftbtn defineButton" @click="confirm">确定</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			title: {
				type: String,
				default: '输入密码'
			}
		},
		data() {
			return {
				pwd: '',
				pwdType: 'password',
			}
		},
		methods: {
			confirm: function(e) {
				this.$emit('confirm', this.pwd);
			},
			cancel() {
				this.$emit('cancel');
			},
			eyeFn() {
				this.pwdType = this.pwdType === 'password' ? 'text' : 'password'
			}
		},
	}
</script>

<style lang="less">
	.pop-promot-box {
		width: 100%;
		height: 100%;
		position: fixed;
		background-color: rgba(0, 0, 0, 0.5);
		z-index: 1;
		top: 0;
		left: 0;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	/* .pop-promot-back{
	    padding: 40rpx;
	    width: 70%;
	    margin: 0 15%;
	    border-radius: 20rpx;
	    background: #fff;
	    box-sizing: border-box;
	    display: flex;
	    flex-direction: column;
	    align-items: center;
	    justify-content: center;
	  } */
	.pop-back-img {
		width: 100%;
		height: 100%;
		top: 0px;
		left: 0px;
		z-index: 99;
		position: absolute;
	}
	
	.pop-content-back {
		width: 100%;
		height: 100%;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		z-index: 100;
	}
	
	.pop-promot-back {
		padding: 5% 5%;
		width: 80%;
		margin: 0 10%;
		border-radius: 10px;
		/* background-image: url(https://cdn.spbcn.org/spbcnappneed/onlineGameRuleBackView2.png);
	    background-repeat: no-repeat;
	    background-size: 100% 100%;  box-sizing: border-box; */
		background: linear-gradient(0deg, #130E00 0%, #373632 100%);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		position: relative;
	}
	
	
	.pop-promot-count {
		font-size: 14px;
		color: black;
		text-align: left;
		font-weight: 600;
		padding: 10px 0;
		border-radius: 10px;
		margin-top: 5px;
		color: #fff;
		line-height: 26px;
		font-family: normal;
	}
	
	.pop-promot-button {
		margin-top: 13px;
		width: 120px;
		height: 32px;
		border-radius: 32px;
		color: #000;
		font-size: 14px;
		font-family: 'hzgb';
		text-align: center;
		background: linear-gradient(to bottom, #ffd16b, #fff497);
		box-shadow: 0px 6px 0px 0px #d9b059;
		line-height: 32px;
	}
	.pop-promot-title {
	    font-size: 18px;
	    color: white;
	    text-align: center;
	    margin-bottom: 8px;
	    font-family: 'hzgb';
		// text-shadow: -1px 1px 0 #992722, 1px 1px 0 #992722,1px -1px 0 #992722,-1px -1px 0 #992722;
		// -webkit-text-stroke: 1px #992722;
	  }
	  .text-content-view{
		  width: 100%;
		  display: flex;
		  flex-direction: column;
		  align-items: center;
		  justify-content: center;
		  box-sizing: border-box;
	  }
	  .close-btn{
		  position: absolute;
		  right: 18px;
		  top: 16px;
		  z-index: 1000;
		  width: 24px;
		  height: 24px;
	  }
	  
	  .kefu{
		  .txt{
			  text-align: center;
			  color: #fff;
			  font-size: 12px;
			  margin-bottom: 10px;
		  }
		  .img{
			  width: 200px;
			  height: 200px;
		  }
	  }
	  
	  .pop-promot-bottomView {
	  	width: 100%;
	  	height: 30px;
	  	display: flex;
	  	flex-direction: row;
	  	justify-content: space-around;
	  	margin-top: 15px;
	  }
	  
	  .bottom-leftbtn {
	  	width: 120px;
	  	height: 32px;
	  	line-height: 32px;
	  	border-radius: 15px;
	  	font-size: 14px;
	  	text-align: center;
	  	// font-weight: 800;
	  }
	  
	  .defineButton {
	  	color: #000;
	  	font-family: hzgb;
	  	background: linear-gradient(to bottom, #ffd16b, #fff497);
	  	box-shadow: 0px 6px 0px 0px #d9b059;
	  }
	  
	  .cancelButton {
	  	color: #fff;
	  	font-family: hzgb;
	  	background: linear-gradient(to bottom, #130e00, #373632);
	  	box-shadow: 0px 6px 0px 0px #9b8b6f;
	  }
	  .pwd-input{
	  	border: none;
	  	border-width: 0 !important;
	  	font-size: 14px;
	  	font-family: normal;
	  	text-align: center;
	  	&.uv-border{
	  		border-width: 0 !important;
	  	}
	  }
	  .pwd{
	  	width: 100%;
	  	height: 36px;
	  	background: #fff8e1;
	  	border-radius: 32px;
	  	box-sizing: border-box;
	  	padding-left: 8px;
	  	padding-right: 2px;
	  	margin-top: 20px;
		margin-bottom: 20px;
	  	position: relative;
	  	.eye{
	  		position: absolute;
	  		right: 10px;
	  		top: 0;
	  		height: 24px;
	  		width: 24px;
	  		margin-top: 6px;
	  	}
	  }
	  ::v-deep .uni-input-input {
	  	text-align: center;
	  }
</style>